<template>
  <el-form :model="fromData" :rules="fromData_rules" ref="fromDataRef" label-width="100px">
    <el-form-item label="设备类型" prop="deviceType">
      <el-select class="w100" v-model="fromData.deviceType" placeholder="请选择">
        <el-option v-for="item in $store.state.instrumentList" :key="item.id" :label="item.name" :value="item.id">
        </el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="出厂编号" prop="factoryNumber">
      <el-input v-model="fromData.factoryNumber"></el-input>
    </el-form-item>
    <el-form-item label="规格型号" prop="specificationsModel">
      <el-input v-model="fromData.specificationsModel"></el-input>
    </el-form-item>
    <el-form-item label="检定时间" prop="testTime">
      <el-input v-model="fromData.testTime"></el-input>
    </el-form-item>
    <el-form-item label="检定结果" prop="testResults">
      <el-input v-model="fromData.testResults"></el-input>
    </el-form-item>
    <el-form-item label="检定证书号" prop="verificationCertificateNumber">
      <el-input v-model="fromData.verificationCertificateNumber"></el-input>
    </el-form-item>
    <el-form-item label="检定单位" prop="testUnit">
      <el-input v-model="fromData.testUnit"></el-input>
    </el-form-item>
    <el-form-item label="保管负责人" prop="custodian">
      <el-input v-model="fromData.custodian"></el-input>
    </el-form-item>
    <el-form-item label="联系电话" prop="custodianNumber">
      <el-input v-model="fromData.custodianNumber"></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  props: {
    fromData: {},
    options: []
  },
  data() {
    return {
      // 设备,
      fromData_rules: {
        deviceType: [{ required: true, message: '请选择设备类型', trigger: ['blur', 'change'] }],
        factoryNumber: [{ required: true, message: '请输入出厂编号', trigger: 'blur' }],
        specificationsModel: [{ required: true, message: '请输入规格型号', trigger: 'blur' }]
      }
    }
  },
  methods: {
    validate() {
      let res_bool = false
      this.$refs.fromDataRef.validate(bool => {
        res_bool = bool
      })
      return res_bool
    },
    resetFields() {
      this.$refs.fromDataRef.resetFields()
    }
  }
}
</script>

<style>
</style>